package com.jiedeng.dao;

import com.jiedeng.model.Check;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @author 覃远龙
 * @ClassName: ICheckRepository
 * @Description:
 * @date 2017/8/4 11:08
 */
public interface ICheckRepository extends JpaRepository<Check, String> {

    List<Check> findByTaskId(String taskId);
    List<Check> findByTaskIdOrderByCheckTimeDesc(String taskId);
    List<Check> findByTaskIdAndIsPub(String taskId, boolean isPub);

    List<Check> findByTaskIdAndIsCloseFile(String taskId, boolean isCloseFile);
    List<Check> findByTaskIdAndIsCloseFileAndIsPub(String taskId, boolean isCloseFile, boolean isPub);

    List<Check> findByTaskIdAndIsCloseFileOrderByCheckItemIdDescCheckTimeDesc(String taskId, boolean isCloseFile);
    List<Check> findByTaskIdAndIsCloseFileOrderByCheckTimeDesc(String taskId, boolean isCloseFile);

    List<Check> findByEventIdAndIsCloseFile(String eventId, boolean isCloseFile);

    List<Check> findByEventIdAndIsCloseFileOrderByCheckTimeDesc(String eventId, boolean isCloseFile);
    List<Check> findByEventIdAndIsCloseFileOrderByCheckItemIdDescCheckTimeDesc(String eventId, boolean isCloseFile);

    List<Check> findByEventId(String eventId);

}
